﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;

namespace DNA.Mvc.Publishing
{
    [Table("publishing_comments")]
    public class Comment
    {
        public Comment() 
        {
            Posted = DateTime.Now;
            IP = "127.0.0.1";
        }

        [Key]
        public virtual int ID { get; set; }

        [MaxLength(50)]
        public virtual string Title { get; set; }

        public virtual int ArticleID { get; set; }

        [ForeignKey("ArticleID")]
        public virtual Article Article { get; set; }

        [Required,Column(TypeName="ntext")]
        public virtual string Body { get; set; }

        [Required,MaxLength(1024)]
        public virtual string Email { get; set; }

        [Required,MaxLength(50)]
        public virtual string IP { get; set; }

        [Required]
        public virtual DateTime Posted { get; set; }

        [Required,MaxLength(50)]
        public virtual string UserName { get; set; }

        [MaxLength(1024)]
        public virtual string WebSite { get; set; }

        [Required]
        public virtual bool IsPingback { get; set; }

        [Required]
        public virtual bool IsTrackback { get; set; }

        public virtual bool IsApproved { get; set; }

        public virtual string UrlReferrer { get; set; }
    }
}
